Scroll to navigation

EDITRC(5) File Formats Manual EDITRC(5)

NAME

editrcconfiguration file for editline library

SYNOPSIS

editrc

DESCRIPTION

The editrc file defines various settings to be used by the editline(3) library.

The format of each line is:

[prog:]command [arg [...]]

command is one of the editline(3) builtin commands. Refer to BUILTIN COMMANDS for more information.

prog is the program name string that a program defines when it calls el_init(3) to set up editline(3), which is usually argv[0]. command will be executed for any program which matches prog.

prog may also be a regex(3) style regular expression, in which case command will be executed for any program that matches the regular expression.

If prog is absent, command is executed for all programs.

BUILTIN COMMANDS

The editline library has some builtin commands, which affect the way that the line editing and history functions operate. These are based on similar named builtins present in the tcsh(1) shell.

The following builtin commands are available:

[-a] [-e] [-k] [-l] [-r] [-s] [-v] [key [command]]
Without options, list all bound keys, and the editor command to which each is bound. If key is supplied, show the bindings for key. If key command is supplied, bind command to key. Options include:
Bind all keys to the standard GNU Emacs-like bindings.
Bind all keys to the standard vi(1)-like bindings.
List or change key bindings in the vi(1) mode alternate (command mode) key map.
key is interpreted as a symbolic arrow key name, which may be one of ‘up’, ‘down’, ‘left’ or ‘right’.
List all editor commands and a short description of each.
Remove a key's binding.
command is taken as a literal string and treated as terminal input when key is typed. Bound keys in command are themselves reinterpreted, and this continues for ten levels of interpretation.

command may be one of the commands documented in EDITOR COMMANDS below, or another key.

key and command can contain control characters of the form ‘^character’ (e.g. ‘^A’), and the following backslashed escape sequences:

Bell
Backspace
Escape
Formfeed
Newline
Carriage return
Horizontal tab
Vertical tab
\nnn
The ASCII character corresponding to the octal number nnn.

‘\’ nullifies the special meaning of the following character, if it has any, notably ‘\’ and ‘^’.

[-sv] arg ...
Exercise terminal capabilities given in arg .... If arg is ‘baud’, ‘cols’, ‘lines’, ‘rows’, ‘meta’, or ‘tabs’, the value of that capability is printed, with “yes” or “no” indicating that the terminal does or does not have that capability.

-s returns an empty string for non-existent capabilities, rather than causing an error. -v causes messages to be verbose.

[on | off]
Enable or disable the editline functionality in a program.
list | size n | unique n
The list command lists all entries in the history. The size command sets the history size to n entries. The unique command controls if history should keep duplicate entries. If n is non zero, only keep unique history entries. If n is zero, then keep all entries (the default).
List the values of all the terminal capabilities (see termcap(5)).
cap val
Set the terminal capability cap to val, as defined in termcap(5). No sanity checking is done.
[-a] [-d] [-q] [-x] [+mode] [-mode] [mode] [char=c]
Control which tty modes that editrc won't allow the user to change. -d, -q or -x tells setty to act on the ‘edit’, ‘quote’ or ‘execute’ set of tty modes respectively; defaulting to -x.

Without other arguments, setty lists the modes in the chosen set which are fixed on (‘+mode’) or off (‘-mode’). -a lists all tty modes in the chosen set regardless of the setting. With +mode, -mode or mode, fixes mode on or off or removes control of mode in the chosen set.

Setty can also be used to set tty characters to particular values using char=value. If value is empty then the character is set to _POSIX_VDISABLE.

EDITOR COMMANDS

The following editor commands are available for use in key bindings:

Vi paste previous deletion to the right of the cursor.
Vi paste previous deletion to the left of the cursor.
Vi move to the previous space delimited word.
Vi move to the previous word.
Vi move to the next space delimited word.
Vi move to the next word.
Vi change case of character under the cursor and advance one character.
Vi change prefix command.
Vi enter insert mode at the beginning of line.
Vi replace character under the cursor with the next character typed.
Vi enter replace mode.
Vi replace character under the cursor and enter insert mode.
Vi substitute entire line.
Vi change to end of line.
Vi enter insert mode.
Vi enter insert mode after the cursor.
Vi enter insert mode at end of line.
Vi delete prefix command.
Vi move to the end of the current space delimited word.
Vi move to the end of the current word.
Vi undo last change.
Vi enter command mode (use alternative key bindings).
Vi move to the beginning of line.
Vi move to previous character (backspace).
Vi list choices for completion or indicate end of file if empty line.
Vi cut from beginning of line to cursor.
Vi search history previous.
Vi search history next.
Vi repeat current search in the same search direction.
Vi repeat current search in the opposite search direction.
Vi move to the character specified next.
Vi move to the character specified previous.
Vi move up to the character specified next.
Vi move up to the character specified previous.
Vi repeat current character search in the same search direction.
Vi repeat current character search in the opposite search direction.
Delete character under cursor or list completions if at end of line.
Cut from cursor to end of current word.
Paste cut buffer at cursor position.
Cut the entire line and save in cut buffer.
Cut area between mark and cursor and save in cut buffer.
Copy area between mark and cursor to cut buffer.
Exchange the two characters before the cursor.
Move next to end of current word.
Uppercase the characters from cursor to end of current word.
Capitalize the characters from cursor to end of current word.
Lowercase the characters from cursor to end of current word.
Set the mark at cursor.
Exchange the cursor and mark.
Universal argument (argument times 4).
Add 8th bit to next character typed.
Switch from insert to overwrite mode or vice versa.
Copy current word to cursor.
Emacs incremental next search.
Emacs incremental reverse search.
Indicate end of file.
Add character to the line.
Delete from beginning of current word to cursor.
Delete character under cursor.
Cut to the end of line.
Move cursor to the end of line.
Move cursor to the beginning of line.
Exchange the character to the left of the cursor with the one under it.
Move to the right one character.
Move to the beginning of the current word.
Move to the left one character.
Add the next character typed verbatim.
Adds to argument or enters a digit.
Digit that starts argument.
Indicates unbound character.
Tty interrupt character.
Tty delayed suspend character.
Tty flush output characters.
Tty quit character.
Tty suspend character.
Tty disallow output characters.
Tty allow output characters.
Execute command.
Delete the character to the left of the cursor.
Clear screen leaving current line at the top.
Redisplay everything.
Erase current line and start from scratch.
First character in a bound sequence.
Move to the previous history line.
Move to the next history line.
Search previous in history for a line matching the current.
Search next in history for a line matching the current.
Move up one line.
Move down one line.
Editline extended command.

SEE ALSO

editline(3), regex(3), termcap(5)

AUTHORS

The editline library was written by Christos Zoulas, and this manual was written by Luke Mewburn, with some sections inspired by tcsh(1).

October 18, 2003 Linux 5.14.0-427.18.1.el9_4.x86_64